package book_management.operation.impl;
import book_management.book.BookList;
import book_management.operation.IOperation;

public class ReturnOperation implements IOperation {
    @Override
    public void work(BookList bookList){
        System.out.println("您现在进行的是还书操作~");
        System.out.println("请输入您要换的书籍名称:");
        String booksName=scanner.next();
        if(bookList.isContains(booksName)){
            if(bookList.isBookBorrowed(booksName)){
                bookList.returnBook(booksName);
                System.out.println("还书成功~");
            }else{
                System.out.println("该书您没有借，不用还！");
            }
        }else{
            System.out.println("该书不存在~");
        }
    }
}
